// Definition of class which describes the attributes of a model
// Copyright 2004 (C) Ralph Thomas

#ifndef MODEL_ATTRIBUTE_INFO_H
#define MODEL_ATTRIBUTE_INFO_H

#include <string>

namespace model {
	//
	/// The attributeInfo class describes the attributes of a model.
	//
	class attributeInfo {
		class attributeInfoImpl* _impl;
	  public:
		//
		// attributeInfo()
		//
		/// Create a new attributeInfo object, detailing the
		/// attributes of a model, and if they are read-write
		/// or read-only.
		//
		attributeInfo();
		//
		// attributeInfo( attributeInfo& ai )
		//
		/// Create an attributeInfo object from another one.
		//
		attributeInfo( const attributeInfo& ai );
		//
		// ~attributeInfo()
		//
		/// Virtual destructor.
		//
		virtual ~attributeInfo();
		//
		// unsigned int getNumberAttributes() const
		//
		/// Return the number of attributes which this class describes.
		///
		/// \return	the number of attributes described.
		//
		unsigned int getNumberAttributes() const;
		//
		// const std::string& getName() const
		//
		/// Return the name of the attribute to which this information
		/// pertains.
		///
		/// \param	i	the index of the attribute to return
		///			the name of.
		/// \return	the name of the attribute this attributeInfo
		///		describes.
		//
		const std::string& getName( unsigned int i ) const;
		//
		// bool getSettable() const
		//
		/// If the described attribute is settable then true is returned.
		/// However, if the attribute is read-only then false is returned.
		///
		/// \param	i	the index of the attribute to return
		///			the name of.
		///
		/// \return	true if the attribute is read-write, false if it
		///		is read-only.
		//
		bool getSettable( unsigned int i ) const;
		//
		// void addAttribute( const std::string& name, bool settable )
		//
		/// Add an attribute to the list of attributes described. If this
		/// attribute already exists in the listing then this definition
		/// overwrites it.
		///
		/// \param	name		the name of the attribute to add
		/// \param	settable	is the new attribute settable or
		///				not.
		//
		void addAttribute( const std::string& name, bool settable );
		//
		// attributeInfo& operator=( const attributeInfo& ai )
		//
		/// Equals operator; this operator causes the right kind of copy
		/// (fairly deep) to happen, versus copying the instance pointer
		/// (which could result in it being free'd multiple times).
		///
		/// \param	ai	the attributeInfo to become equal to
		///
		/// \return	the new value of this attributeInfo.
		//
		attributeInfo& operator=( const attributeInfo& ai );
		//
		// bool operator==( const attributeInfo& rhs ) const
		//
		/// Equality operator, used by C++ to test equality of this
		/// attributeInfo instance with another.
		///
		/// \param	rhs	the attributeInfo to compare against.
		///
		/// \return	true if the two instances are equal, false
		///		otherwise.
		//
		bool operator==( const attributeInfo& rhs ) const;
	};
};

#endif

